package com.lightkits.wms.controller;

import com.lightkits.wms.domain.deliveryticket.QueryDeliveryTicketExecutor;
import com.lightkits.wms.domain.deliveryticket.QueryTicketByIdExecutor;
import com.lightkits.wms.domain.deliveryticket.SaveTicketHeadExecutor;
import com.lightkits.wms.domain.deliveryticket.SaveTicketLineExecutor;
import com.lightkits.wms.dto.deliveryticket.QueryDeliveryTicketRequestType;
import com.lightkits.wms.dto.deliveryticket.QueryDeliveryTicketResponseType;
import com.lightkits.wms.dto.deliveryticket.QueryTicketByIdRequestType;
import com.lightkits.wms.dto.deliveryticket.QueryTicketByIdResponseType;
import com.lightkits.wms.dto.deliveryticket.SaveTicketHeadRequestType;
import com.lightkits.wms.dto.deliveryticket.SaveTicketHeadResponseType;
import com.lightkits.wms.dto.deliveryticket.SaveTicketLineRequestType;
import com.lightkits.wms.dto.deliveryticket.SaveTicketLineResponseType;
import io.choerodon.swagger.annotation.Permission;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * DeliveryTicketService
 *
 * @author jing.wei@hand-china.com
 * Created on 2019/4/19 14:17
 */
@RestController
@RequestMapping("/DeliveryTicketService")
public class DeliveryTicketController {

    @PostMapping(value = "/queryDeliveryTicket")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/queryDeliveryTicket")
    @ResponseBody
    public QueryDeliveryTicketResponseType queryDeliveryTicket(@RequestBody(required = false) QueryDeliveryTicketRequestType request) {
        return queryDeliveryTicketExecutor.service(request);
    }

    @Autowired
    private QueryDeliveryTicketExecutor queryDeliveryTicketExecutor;

    @PostMapping(value = "/queryTicketById")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/queryTicketById")
    @ResponseBody
    public QueryTicketByIdResponseType queryTicketById(@RequestBody(required = false) QueryTicketByIdRequestType request) {
        return queryTicketByIdExecutor.service(request);
    }

    @Autowired
    private QueryTicketByIdExecutor queryTicketByIdExecutor;

    @PostMapping(value = "/saveTicketHead")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/saveTicketHead")
    @ResponseBody
    public SaveTicketHeadResponseType saveTicketHead(@RequestBody(required = false) SaveTicketHeadRequestType request) {
        return saveTicketHeadExecutor.service(request);
    }

    @Autowired
    private SaveTicketHeadExecutor saveTicketHeadExecutor;

    @PostMapping(value = "/saveTicketLine")
    @Permission(permissionPublic = true)
    @ApiOperation(value = "/saveTicketLine")
    @ResponseBody
    public SaveTicketLineResponseType saveTicketLine(@RequestBody(required = false) SaveTicketLineRequestType request) {
        return saveTicketLineExecutor.service(request);
    }

    @Autowired
    private SaveTicketLineExecutor saveTicketLineExecutor;
}
